package com.menchao.carsales.common.http;

/**
 * Porject: carsales
 * Date: 2021/7/13
 * Author: menchao
 * Description:
 */

public enum  ResponseCode {

    //#1000～1999 区间表示参数错误
    //#2000～2999 区间表示用户错误
    //#3000～3999 区间表示接口异常



    SUCCESS(0, "操作成功"),

    ERROR_AUTH(1001,"用户名或密码错误"),
    NEED_PARAM(1002,"缺少参数"),
    USER_NOT_FOUND(1003,"用户不存在"),

    UNAUTHORIZED(2001, "非法访问"),
    NOT_PERMISSION(2002, "没有权限"),
    NOT_FOUND(2003, "你请求的路径不存在"),

    FAIL(3000, "操作失败"),
    SYSTEM_EXCEPTION(3001,"系统异常!"),
    PARAMETER_EXCEPTION(3002,"请求参数校验异常"),
    PARAMETER_PARSE_EXCEPTION(3003,"请求参数解析异常"),
    HTTP_MEDIA_TYPE_EXCEPTION(3004,"HTTP Media 类型异常"),
    SYSTEM_LOGIN_EXCEPTION(3005,"系统登录异常");


    private final int code;
    private final String desc;

    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

}
